/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * UpdateItem.java
 *
 * Created on 22-06-2011, 10:58:10
 */
package GUILayer;
import ControlLayer.*;
import ModelLayer.*;
import java.awt.Color;
import java.awt.Component;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JFrame;
/**
 *
 * @author Alex
 */
public class UpdateItem extends javax.swing.JFrame {

    private Item itemHolder;
    private ItemController itemController;
    private SupplierController supplierController;
    private Supplier supplier;
    private Component controllingFrame;
    
    public UpdateItem(Item item) {
        initComponents();
        itemController = new ItemController();
        itemHolder = item;
        loadFields();
        supplier = item.getSupplier();
    }
    
    private void loadFields()
    {
        enterUpdateBarcodeTextField2.setText(itemHolder.getBarcode());
        enterUpdateItemNumberTextField2.setText(itemHolder.getItemNumber());
        enterUpdateNameTextField1.setText(itemHolder.getName());
        enterUpdateBuyingPriceTextField1.setText("" +itemHolder.getBuyingPrice());
        enterUpdateSellingPriceTextField1.setText("" + itemHolder.getSellingPrice());
        enterUpdateDiscountTextField2.setText("" + itemHolder.getDiscount());
        enterUpdateLocationNumberTextField1.setText(itemHolder.getLocationsNumber());
        enterUpdateAmountInStockTextField1.setText("" + itemHolder.getAmountInStock());
        enterUpdateAmountPrOrderTextField1.setText("" + itemHolder.getAmountPrOrder());
        enterUpdateMinimumInStockTextField1.setText("" + itemHolder.getMinStock());
        enterUpdateMaximumInStockTextField1.setText("" + itemHolder.getMaxStock());
        enterUpdateSupplierTextField1.setText(itemHolder.getSupplier().getName());
        enterUpdateDescriptionTextArea1.setText(itemHolder.getDescription());
                
    }
    
    protected void setSellBuyDiscountPriceFieldsFalse()
    {
        enterUpdateBuyingPriceTextField1.setEnabled(false);
        enterUpdateSellingPriceTextField1.setEnabled(false);
        enterUpdateDiscountTextField2.setEnabled(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        updateItemPanel1 = new javax.swing.JPanel();
        updateItemLabel1 = new javax.swing.JLabel();
        enterUpdateBarcodeLabel1 = new javax.swing.JLabel();
        enterUpdateNameTextField1 = new javax.swing.JTextField();
        enterUpdateItemNumberLabel1 = new javax.swing.JLabel();
        enterUpdateItemNumberTextField2 = new javax.swing.JTextField();
        enterUpdateNameLabel1 = new javax.swing.JLabel();
        enterUpdateDescriptionLabel1 = new javax.swing.JLabel();
        enterUpdateBuyingPriceLabel1 = new javax.swing.JLabel();
        enterUpdateSellingPriceLabel1 = new javax.swing.JLabel();
        enterUpdateLocationNumberLabel1 = new javax.swing.JLabel();
        enterUpdateAmountInStockLabel1 = new javax.swing.JLabel();
        enterUpdateAmountPrOrderLabel1 = new javax.swing.JLabel();
        enterUpdateMinimumInStockLabel1 = new javax.swing.JLabel();
        enterUpdateMaximumInStockLabel1 = new javax.swing.JLabel();
        enterUpdateSuppplierLabel1 = new javax.swing.JLabel();
        enterUpdateBarcodeTextField2 = new javax.swing.JTextField();
        enterUpdateBuyingPriceTextField1 = new javax.swing.JTextField();
        enterUpdateSellingPriceTextField1 = new javax.swing.JTextField();
        enterUpdateLocationNumberTextField1 = new javax.swing.JTextField();
        enterUpdateAmountInStockTextField1 = new javax.swing.JTextField();
        enterUpdateAmountPrOrderTextField1 = new javax.swing.JTextField();
        enterUpdateMinimumInStockTextField1 = new javax.swing.JTextField();
        enterUpdateMaximumInStockTextField1 = new javax.swing.JTextField();
        enterUpdateSupplierTextField1 = new javax.swing.JTextField();
        okayUpdateItemButton1 = new javax.swing.JButton();
        cancelUpdateItemButton1 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        enterUpdateDescriptionTextArea1 = new javax.swing.JTextArea();
        enterUpdateLocationNumberLabel2 = new javax.swing.JLabel();
        enterUpdateDiscountTextField2 = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        updateItemPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Update item"));

        updateItemLabel1.setText("Enter the information of the item you want to change:");

        enterUpdateBarcodeLabel1.setText("Enter barcode:");

        enterUpdateItemNumberLabel1.setText("Enter item number:");

        enterUpdateItemNumberTextField2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                enterUpdateItemNumberTextField2ActionPerformed(evt);
            }
        });

        enterUpdateNameLabel1.setText("Enter name:");

        enterUpdateDescriptionLabel1.setText("Enter description:");

        enterUpdateBuyingPriceLabel1.setText("Enter buying price:");

        enterUpdateSellingPriceLabel1.setText("Enter selling price:");

        enterUpdateLocationNumberLabel1.setText("Enter location number:");

        enterUpdateAmountInStockLabel1.setText("Enter amount in stock:");

        enterUpdateAmountPrOrderLabel1.setText("Enter amount pr order:");

        enterUpdateMinimumInStockLabel1.setText("Enter minimum in stock:");

        enterUpdateMaximumInStockLabel1.setText("Enter maximum in stock:");

        enterUpdateSuppplierLabel1.setText("Enter supplier:");

        enterUpdateBarcodeTextField2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                enterUpdateBarcodeTextField2ActionPerformed(evt);
            }
        });

        enterUpdateAmountPrOrderTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                enterUpdateAmountPrOrderTextField1ActionPerformed(evt);
            }
        });

        okayUpdateItemButton1.setText("Update");
        okayUpdateItemButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okayUpdateItemButton1ActionPerformed(evt);
            }
        });

        cancelUpdateItemButton1.setText("Cancel");
        cancelUpdateItemButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelUpdateItemButton1ActionPerformed(evt);
            }
        });

        enterUpdateDescriptionTextArea1.setColumns(20);
        enterUpdateDescriptionTextArea1.setRows(5);
        jScrollPane1.setViewportView(enterUpdateDescriptionTextArea1);

        enterUpdateLocationNumberLabel2.setText("Enter discount:");

        javax.swing.GroupLayout updateItemPanel1Layout = new javax.swing.GroupLayout(updateItemPanel1);
        updateItemPanel1.setLayout(updateItemPanel1Layout);
        updateItemPanel1Layout.setHorizontalGroup(
            updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(updateItemPanel1Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(updateItemLabel1)
                .addContainerGap(110, Short.MAX_VALUE))
            .addGroup(updateItemPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(enterUpdateDescriptionLabel1)
                .addContainerGap(285, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, updateItemPanel1Layout.createSequentialGroup()
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(updateItemPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(enterUpdateSuppplierLabel1)
                            .addComponent(enterUpdateMaximumInStockLabel1)
                            .addComponent(enterUpdateMinimumInStockLabel1)))
                    .addGroup(updateItemPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(enterUpdateItemNumberLabel1)
                            .addComponent(enterUpdateNameLabel1)
                            .addComponent(enterUpdateBuyingPriceLabel1)
                            .addComponent(enterUpdateSellingPriceLabel1)))
                    .addGroup(updateItemPanel1Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(enterUpdateBarcodeLabel1))
                    .addGroup(updateItemPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(enterUpdateLocationNumberLabel2))
                    .addGroup(updateItemPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(enterUpdateLocationNumberLabel1)
                            .addComponent(enterUpdateAmountInStockLabel1)
                            .addComponent(enterUpdateAmountPrOrderLabel1))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(updateItemPanel1Layout.createSequentialGroup()
                        .addComponent(okayUpdateItemButton1)
                        .addGap(18, 18, 18)
                        .addComponent(cancelUpdateItemButton1))
                    .addComponent(enterUpdateBarcodeTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(enterUpdateItemNumberTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(enterUpdateNameTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(enterUpdateBuyingPriceTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(enterUpdateSellingPriceTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(enterUpdateDiscountTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(enterUpdateLocationNumberTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(enterUpdateAmountPrOrderTextField1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(enterUpdateMinimumInStockTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(enterUpdateMaximumInStockTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(enterUpdateSupplierTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(enterUpdateAmountInStockTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(25, Short.MAX_VALUE))
        );
        updateItemPanel1Layout.setVerticalGroup(
            updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(updateItemPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(updateItemLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateBarcodeLabel1)
                    .addComponent(enterUpdateBarcodeTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateItemNumberLabel1)
                    .addComponent(enterUpdateItemNumberTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateNameLabel1)
                    .addComponent(enterUpdateNameTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateBuyingPriceLabel1)
                    .addComponent(enterUpdateBuyingPriceTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateSellingPriceLabel1)
                    .addComponent(enterUpdateSellingPriceTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateLocationNumberLabel2)
                    .addComponent(enterUpdateDiscountTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateLocationNumberLabel1)
                    .addComponent(enterUpdateLocationNumberTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateAmountInStockLabel1)
                    .addComponent(enterUpdateAmountInStockTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateAmountPrOrderLabel1)
                    .addComponent(enterUpdateAmountPrOrderTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateMinimumInStockLabel1)
                    .addComponent(enterUpdateMinimumInStockTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateMaximumInStockLabel1)
                    .addComponent(enterUpdateMaximumInStockTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(enterUpdateSuppplierLabel1)
                    .addComponent(enterUpdateSupplierTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(enterUpdateDescriptionLabel1)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(updateItemPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(okayUpdateItemButton1)
                    .addComponent(cancelUpdateItemButton1))
                .addContainerGap(60, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(updateItemPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(updateItemPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(38, 38, 38))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void enterUpdateItemNumberTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterUpdateItemNumberTextField2ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_enterUpdateItemNumberTextField2ActionPerformed

    private void okayUpdateItemButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okayUpdateItemButton1ActionPerformed
        try{
        itemHolder.setBarcode(enterUpdateBarcodeTextField2.getText());
        itemHolder.setItemNumber(enterUpdateItemNumberTextField2.getText());
        itemHolder.setName(enterUpdateNameTextField1.getText());
        itemHolder.setBuyingPrice(Double.parseDouble(enterUpdateBuyingPriceTextField1.getText()));
        itemHolder.setSellingPrice(Double.parseDouble(enterUpdateSellingPriceTextField1.getText()));
        itemHolder.setDiscount(Integer.parseInt(enterUpdateDiscountTextField2.getText()));
        itemHolder.setLocationsNumber(enterUpdateLocationNumberTextField1.getText());
        itemHolder.setAmountInStock(Integer.parseInt(enterUpdateAmountInStockTextField1.getText()));
        itemHolder.setAmountPrOrder(Integer.parseInt(enterUpdateAmountPrOrderTextField1.getText()));
        itemHolder.setMinStock(Integer.parseInt(enterUpdateMinimumInStockTextField1.getText()));
        itemHolder.setMaxStock(Integer.parseInt(enterUpdateMaximumInStockTextField1.getText()));
        }catch(Exception e){
            JOptionPane.showMessageDialog(controllingFrame, "Item update failed, check your input types","Failed!", JOptionPane.INFORMATION_MESSAGE);
        }
//        try {
//            String newString = (String)enterUpdateSupplierTextField1.getText();
//            Supplier newSupplier =  supplierController.findSupplier(newString);
//            itemHolder.setSupplier(newSupplier);
//        } catch (Exception e) {
//           System.out.println(e.getMessage());
//        }
        try
        {
        String barcodeItem = (String)enterUpdateBarcodeTextField2.getText();
        String supplierName = (String)enterUpdateSupplierTextField1.getText();
       
        if(itemController.updateItemSupplier(barcodeItem, supplierName))
        {
            System.out.println("Supplier updated");
        }
            }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
            
        itemHolder.setDescription(enterUpdateDescriptionTextArea1.getText());
        
        JOptionPane.showMessageDialog(controllingFrame, "Item has been updated...","Success!", JOptionPane.INFORMATION_MESSAGE);
            this.dispose();
}//GEN-LAST:event_okayUpdateItemButton1ActionPerformed

    private void cancelUpdateItemButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelUpdateItemButton1ActionPerformed
        this.dispose();
}//GEN-LAST:event_cancelUpdateItemButton1ActionPerformed

    private void enterUpdateAmountPrOrderTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterUpdateAmountPrOrderTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_enterUpdateAmountPrOrderTextField1ActionPerformed

    private void enterUpdateBarcodeTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enterUpdateBarcodeTextField2ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_enterUpdateBarcodeTextField2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {

            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton cancelUpdateItemButton1;
    private javax.swing.JLabel enterUpdateAmountInStockLabel1;
    private javax.swing.JTextField enterUpdateAmountInStockTextField1;
    private javax.swing.JLabel enterUpdateAmountPrOrderLabel1;
    private javax.swing.JTextField enterUpdateAmountPrOrderTextField1;
    private javax.swing.JLabel enterUpdateBarcodeLabel1;
    private javax.swing.JTextField enterUpdateBarcodeTextField2;
    private javax.swing.JLabel enterUpdateBuyingPriceLabel1;
    private javax.swing.JTextField enterUpdateBuyingPriceTextField1;
    private javax.swing.JLabel enterUpdateDescriptionLabel1;
    private javax.swing.JTextArea enterUpdateDescriptionTextArea1;
    private javax.swing.JTextField enterUpdateDiscountTextField2;
    private javax.swing.JLabel enterUpdateItemNumberLabel1;
    private javax.swing.JTextField enterUpdateItemNumberTextField2;
    private javax.swing.JLabel enterUpdateLocationNumberLabel1;
    private javax.swing.JLabel enterUpdateLocationNumberLabel2;
    private javax.swing.JTextField enterUpdateLocationNumberTextField1;
    private javax.swing.JLabel enterUpdateMaximumInStockLabel1;
    private javax.swing.JTextField enterUpdateMaximumInStockTextField1;
    private javax.swing.JLabel enterUpdateMinimumInStockLabel1;
    private javax.swing.JTextField enterUpdateMinimumInStockTextField1;
    private javax.swing.JLabel enterUpdateNameLabel1;
    private javax.swing.JTextField enterUpdateNameTextField1;
    private javax.swing.JLabel enterUpdateSellingPriceLabel1;
    private javax.swing.JTextField enterUpdateSellingPriceTextField1;
    private javax.swing.JTextField enterUpdateSupplierTextField1;
    private javax.swing.JLabel enterUpdateSuppplierLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton okayUpdateItemButton1;
    private javax.swing.JLabel updateItemLabel1;
    private javax.swing.JPanel updateItemPanel1;
    // End of variables declaration//GEN-END:variables
}
